﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using FacebookXmpp.Parse;

namespace FacebookXmpp.Stanzas
{
	internal class VCard : Stanza
	{
		//public Image Photo { get; private set; }
		public VCard(string userId )
		{
			NextResponse = string.Format( @"<iq id='{0}' type='get' to='{1}'><vCard xmlns='vcard-temp' /></iq>", NextId, userId );
		}

		public override void ProcessResponse(MessageData recieved, XmlStream xmlStream, StreamHandlers handlers)
		{
			handlers.Remove( this );

			MessageData binval = recieved.Path( "vCard/Photo/BINVAL" ) as MessageData;
//			if (binval != null)
//				Photo = new Bitmap( new MemoryStream( Convert.FromBase64String( (string) binval.Value ) ) );
		}

	}
}
